package com.heima.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class OrderStatusListener {
    private static final Logger log = LoggerFactory.getLogger(OrderStatusListener.class);

    /**
     * 创建监听
     */
    @RabbitListener(
            bindings = @QueueBinding(
                    value = @Queue(name = "order.status.queue"),
                    exchange = @Exchange(name = "order.status.direct",delayed = "true",type = ExchangeTypes.DIRECT),
                    key = "delay.task"
            )
    )
    public void listenOrderStatus(String ids){
        log.info("ids");
    }
}
